package demo.miner;

public class ClassBuilding extends ClassEntity {
	
	public static enum Grid {

		PLUS_3_3(3, 3,
				0, 1, 0,
				1, 1, 1,
				0, 1, 0),
				
		SQUARE_3_3(3, 3,
				1, 1, 1,
				1, 1, 1,
				1, 1, 1),

		SQUARE_2_2(2, 2,
				1, 1,
				1, 1);
	    
	    private int[][] grid;
	    
	    private Grid(int w, int h, int ... cell) {
	    	grid = new int[h][w];
	    	for (int i = 0; i < cell.length; i++) {
	    		grid[i%w][i/w] = cell[i];
	    	}
	    }
	    
	    public int[][] getValue() {
	    	return grid;
	    }
		
	}
	
	private int baseWidth;
	private int baseHeight;

	private Grid passableGrid;
	private Grid buildableGrid;

	public ClassBuilding() {
		super(EntityBuilding.class);
	}
	
	public int getBaseWidth() {
		return baseWidth;
	}

	public void setBaseWidth(int baseWidth) {
		this.baseWidth = baseWidth;
	}

	public int getBaseHeight() {
		return baseHeight;
	}

	public void setBaseHeight(int baseHeight) {
		this.baseHeight = baseHeight;
	}

	public Grid getPassableGrid() {
		return passableGrid;
	}

	public void setPassableGrid(Grid passableGrid) {
		this.passableGrid = passableGrid;
	}
	
	public void setPassableGrid(String grid) {
		this.passableGrid = Grid.valueOf(grid);
	}

	public Grid getBuildableGrid() {
		return buildableGrid;
	}

	public void setBuildableGrid(Grid buildableGrid) {
		this.buildableGrid = buildableGrid;
	}
	
	public void setBuildableGrid(String grid) {
		this.buildableGrid = Grid.valueOf(grid);
	}

}
